<?php
//------- logistic wxapp -------
namespace app\admin\validate;

use think\Validate;

class AddressValidate extends Validate
{
    protected $rule = [
        'detail' => 'require',
        'zip' => 'require',
        'receive' => 'require',
        'contact' => 'require',
        'code' => 'require|alpha|unique:address,code',
        
    ];
    protected $message = [
        'detail.require' => '详细地址不能为空',
        'receive.require' => '收货人不能为空',
        'contact.require' => '联系方式不能为空',
        'code.require' => '编号不能为空',
        'code.unique' => '编号已存在',
        'code.alpha' => '编号需输入字母',
        'zip.require' => '邮编不能为空',
    ];

    protected $scene = [
        'add'  => ['detail','zip','code'],
        'edit' => ['detail','zip','code'],
    ];
}